<template>
  <div class="study">
    <div class="left-view">
      <div class="top-content">
        <div v-if="list[leftIndex].showTitle=='show'" class="top-title">{{ list[leftIndex].title }}</div>
        <!-- <div v-if="list[leftIndex].showMore" class="top-more">
          <span>查看更多</span>
          <i class="el-icon-arrow-right"></i>
        </div>-->
      </div>
      <ul>
        <li
          v-for="(item, index) in list[leftIndex].articleList"
          :key="index"
          :class="list[leftIndex].rowNum=='3'?'little':''"
          class="list-li"
        >
          <div class="img-box">
            <!-- <a :href="item.link"> -->
            <img :src="item.imgUrl" alt />
            <!-- </a> -->
          </div>
          <div class="list-info">
            <div class="title">{{ item.title }}</div>
            <div class="content">{{ item.content }}</div>
            <div class="tag">{{ item.tag }}</div>
            <div class="price">{{ item.price=='0'?'免费':'￥'+item.price }}</div>
          </div>
        </li>
      </ul>
    </div>
    <div v-if="list[leftIndex].showRight" class="right-view">
      <div class="nav-title">知识商品设置</div>
      <div class="form-title">标题栏</div>
      <el-radio-group v-model="list[leftIndex].showTitle">
        <el-radio label="show">显示</el-radio>
        <el-radio label="unShow">不显示</el-radio>
      </el-radio-group>
      <div class="form-title">标题名称</div>
      <el-input v-model="list[leftIndex].title"></el-input>
      <!-- <el-checkbox v-model="list[leftIndex].showMore" style="margin-top:10px;">显示"查看更多"入口</el-checkbox> -->
      <div class="form-title">最新来源</div>
      <el-radio v-model="list[leftIndex].source" label="default">默认规则</el-radio>
      <div class="form-hint">默认显示最新的前10个视频，音频，专栏等</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['list', 'leftIndex'],
  data() {
    return {
    }
  },
}
</script>

<style lang="scss" scoped>
.study {
  .left-view {
    cursor: move;
    .top-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px;
      .top-title {
        font-size: 20px;
        font-weight: bold;
      }
      .top-more {
        margin-left: auto;
        color: #999;
      }
    }
    ul {
      margin: 0;
      padding: 0;
      list-style: none;
      display: block;
      min-height: 20px;
      .list-li {
        // float: left;
        display: inline-block;
        width: 18%;
        margin: 1%;
        .img-box {
          height: 170px;
          img {
            border-radius: 5px;
            width: 100%;
            height: 100%;
          }
        }
        .list-info {
          padding: 10px;
          background-color: rgb(252, 249, 249);
          .title {
            font-size: 14px;
            font-weight: bold;
            color: #353535;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            margin-bottom: 5px;
          }
          .content {
            font-size: 12px;
            color: #7a7a7a;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
          .tag {
            font-size: 12px;
            width: 40px;
            border-radius: 5px;
            text-align: center;
            padding: 4px;
            background-color: rgb(38, 174, 236);
            color: #fff;
            margin: 10px 0;
          }
          .price {
          }
        }
      }
      .list-li.little {
        width: 31%;
        height: 165px;
      }
    }
  }
  .right-view {
    float: left;
    position: fixed;
    top: 176px;
    right: 4%;
    width: 16%;
    height: 806px;
    overflow: auto;
    z-index: 7;
    box-sizing: border-box;
    padding: 10px 20px;
    padding-bottom: 200px;
    color: #353535;
    font-size: 14px;
    font-family: 'PingFangSC-Medium';
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    .nav-title {
      height: 50px;
      font-weight: 800;
      line-height: 50px;
      border-bottom: 1px solid #eee;
    }
    .form-title {
      margin: 16px 0px;
      .sign {
        color: red;
      }
    }
    .form-hint {
      font-size: 12px;
      color: #999;
      margin: 10px;
    }
  }
  @media screen and (max-width: 1600px) {
    .left-view {
      ul {
        .list-li {
          .img-box {
            height: 108px;
            img {
            }
          }
        }
      }
    }
    .right-view {
      right: 1%;
      width: 20%;
      padding: 10px;
      padding-bottom: 250px;
      height: 668px;
    }
  }
}
</style>
